package me.nujoug.foctapp;

import android.os.Bundle;

public abstract class FoctWebBaseActivity extends WebBaseActivity {
	protected boolean autoSubmit = false;
	protected String hospCard = "";
	protected String ssID = "";
	protected String expenseType = "";
	
	protected int autoDoctor = 0;
	protected int minPrice;
	protected int maxPrice;
	protected int defaultPrice;
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// accept parameters
		Bundle bunde = this.getIntent().getExtras();
		if (bunde != null){
			autoSubmit = bunde.getBoolean("autoSubmit");
			hospCard = bunde.getString("hospCard");
			ssID = bunde.getString("ssID");
			expenseType = bunde.getString("expenseType");
			minPrice = bunde.getInt("minPrice");
			maxPrice = bunde.getInt("maxPrice");
			defaultPrice = bunde.getInt("defaultPrice");
			autoDoctor = bunde.getInt("autoDoctor");
		}
	}
	
	@Override
	protected void passWebData(Bundle bundle) {
		super.passWebData(bundle);
		if (bundle != null){
			if(thisUrl != null) bundle.putString("Referer", thisUrl);
			bundle.putBoolean("autoSubmit", autoSubmit);
			bundle.putString("hospCard", hospCard);
			bundle.putString("ssID", ssID);
			bundle.putString("expenseType", expenseType);
			bundle.putInt("minPrice", minPrice);
			bundle.putInt("maxPrice", maxPrice);
			bundle.putInt("defaultPrice", defaultPrice);
			bundle.putInt("autoDoctor", autoDoctor);
		}
			
	}

	protected abstract void handleHttpResponse(Object result);
}
